//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.baidu.trace.b;

import android.content.Context;
import android.os.Handler;
import com.baidu.trace.ax;
import java.io.DataInputStream;

public final class g extends Thread {
    private Context a = null;
    private Handler b = null;
    private boolean c = true;
    private DataInputStream d = null;

    public g(Context var1, Handler var2) {
        this.a = var1;
        this.b = var2;
    }

    public final void run() {
        while(this.c) {
            if(d.a(this.a)) {
                try {
                    this.d = a.c();
                    if(this.d != null) {
                        DataInputStream var1 = this.d;
                        if(!ax.a(this.d)) {
                            throw new Exception();
                        }
                    }

                    this.d = null;
                } catch (Exception var2) {
                    if(!this.c) {
                        return;
                    }

                    this.c = false;
                    if(this.b != null) {
                        this.b.obtainMessage(4).sendToTarget();
                    }
                }
            } else {
                this.c = false;
                if(this.b != null) {
                    this.b.obtainMessage(19).sendToTarget();
                }
            }
        }

    }

    public final void a() {
        this.c = false;
    }
}
